class JQRecordDailyService extends global.JQService {
	
    async do_action(){
		
		if(!this.conn)console.log('do_action::conn error');
		let data_obj = this.req_obj.data_obj;
		console.log('record_batis/daily'+111);
		let batis = global.JQSqlBaseIF.instance('record_batis/daily',this.conn);
		console.log('record_batis/daily'+2222);
		let params = {};
		params.visitor_id = this.req_obj.visitor_id;
		params.date = data_obj.date;
		let list = await batis.query(params);
		let overall =0;
		console.log(list);
		if(list && list.length >0){
			list.forEach((item)=>{
				let obj = item.obj;
				if(obj)obj= JSON.parse(obj);
				if(obj)item.obj= obj;
				overall+=item.amount;
			});
		};
	   
		let wrap = {};
		console.log('JQRecordDailyService do_action 11111');

		wrap.list = list;	
		wrap.overall=overall;
		return wrap;			
	}
	

}
module.exports = JQRecordDailyService;


